package com.example.sls.controller.account;


import com.example.sls.service.account.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class RegisterController {

    @Autowired
    private RegisterService registerService;

    @PostMapping("/account/register")
    public Map<String, String> register(@RequestParam Map<String, String> map ){
        String username = map.get("username");
        String phone = map.get("phone");
        String email = map.get("email");
        String password = map.get("password");
        String confirmedPassword = map.get("confirmedPassword");
        String roleId = map.get("roleId");


        return registerService.register(username,phone,email, password,confirmedPassword ,roleId);
    }


}
